package com.lc202401;

/**
 * Description:
 *
 * @Create 2024/1/4 23:12
 * @Version 1.0
 */
public class Solution2240 {
    public long waysToBuyPensPencils(int total, int cost1, int cost2) {
        int num = total / cost1;
        long all = 0L;
        for (int i = 0; i <= num; i++) {
            all += (total - (long) i * cost1) / cost2 + 1;
        }
        return all;
    }
}
